package com.cmc.cloud.cmclink.doc.vo.blnovo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.util.*;

import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;

import org.springframework.format.annotation.DateTimeFormat;

import static com.cmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 提单主信息 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BlnoBaseVO {

    @Schema(description = "订舱号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.bookingno.notblank}")
    @Length(max = 20, message = "{blno.bookingno.length}")
    private String bookingNo;

    @Schema(description = "提单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.blno.notblank}")
    @Length(max = 50, message = "{blno.blno.length}")
    private String blNo;

    @Schema(description = "客户业务号")
    @Length(max = 50, message = "{blno.referenceno.length}")
    private String referenceNo;

    @Schema(description = "订舱船名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.bkgvesselcode.notblank}")
    @Length(max = 50, message = "{blno.bkgvesselcode.length}")
    private String bkgVesselCode;

    @Schema(description = "订舱航次", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.bkgvoyage.notblank}")
    @Length(max = 50, message = "{blno.bkgvoyage.length}")
    private String bkgVoyage;

    @Schema(description = "路径id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20782")
    @NotNull(message = "{blno.routeid.notnull}")
    private Long routeId;

    @Schema(description = "订舱港口", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.currentport.notblank}")
    @Length(max = 5, message = "{blno.currentport.length}")
    private String currentPort;

    @Schema(description = "接货地", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.porcode.notblank}")
    @Length(max = 5, message = "{blno.porcode.length}")
    private String porCode;

    @Schema(description = "装货港", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.polcode.notblank}")
    @Length(max = 5, message = "{blno.polcode.length}")
    private String polCode;

    @Schema(description = "卸货港", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.podcode.notblank}")
    @Length(max = 5, message = "{blno.podcode.length}")
    private String podCode;

    @Schema(description = "目的地", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.delcode.notblank}")
    @Length(max = 5, message = "{blno.delcode.length}")
    private String delCode;

    @Schema(description = "订舱人代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.bkpcode.notblank}")
    @Length(max = 50, message = "{blno.bkpcode.length}")
    private String bkpCode;

    @Schema(description = "一代代码")
    @Length(max = 50, message = "{blno.topagentcode.length}")
    private String topAgentCode;

    @Schema(description = "协议号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.agreementno.notblank}")
    @Length(max = 50, message = "{blno.agreementno.length}")
    private String agreementNo;

    @Schema(description = "运输条款", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.shippingterm.notblank}")
    @Length(max = 50, message = "{blno.shippingterm.length}")
    private String shippingTerm;

    @Schema(description = "舱位代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.spaceowner.notblank}")
    @Length(max = 5, message = "{blno.spaceowner.length}")
    private String spaceOwner;

    @Schema(description = "箱主代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.cntrowner.notblank}")
    @Length(max = 5, message = "{blno.cntrowner.length}")
    private String cntrOwner;

    @Schema(description = "箱状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "{blno.cntrstatus.notblank}")
    @Length(max = 1, message = "{blno.cntrstatus.length}")
    private String cntrStatus;

    @Schema(description = "提单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{blno.bltype.notblank}")
    @Length(max = 20, message = "{blno.bltype.length}")
    private String blType;

    @Schema(description = "客户要求签单类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.signorder.notblank}")
    @Length(max = 1, message = "{blno.signorder.length}")
    private String signOrder;

    @Schema(description = "实际签单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @Length(max = 1, message = "{blno.signtype.length}")
    private String signType;

    @Schema(description = "提单拆并单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{blno.splitcombinetype.notblank}")
    @Length(max = 20, message = "{blno.splitcombinetype.length}")
    private String splitCombineType;

    @Schema(description = "始发港提单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{blno.sistatus.notblank}")
    @Length(max = 20, message = "{blno.sistatus.length}")
    private String siStatus;

    @Schema(description = "si通知邮箱 （收，可多）")
    @Length(max = 300, message = "{blno.sinotifyemails.length}")
    private String siNotifyEmails;

    @Schema(description = "锁单标识", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blno.bllockflag.notnull}")
    private Boolean blLockFlag;

    @Schema(description = "D/O状态", example = "2")
    @Length(max = 50, message = "{blno.dostatus.length}")
    private String doStatus;

    @Schema(description = "接货地名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.pordesc.notblank}")
    @Length(max = 50, message = "{blno.pordesc.length}")
    private String porDesc;

    @Schema(description = "装货港名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.poldesc.notblank}")
    @Length(max = 50, message = "{blno.poldesc.length}")
    private String polDesc;

    @Schema(description = "卸货港名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.poddesc.notblank}")
    @Length(max = 50, message = "{blno.poddesc.length}")
    private String podDesc;

    @Schema(description = "目的地名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.deldesc.notblank}")
    @Length(max = 50, message = "{blno.deldesc.length}")
    private String delDesc;

    @Schema(description = "提单打印份数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.printblnumber.notblank}")
    @Length(max = 1, message = "{blno.printblnumber.length}")
    private Integer printBlNumber;

    @Schema(description = "提单打印地")
    @Length(max = 5, message = "{blno.issueplace.length}")
    private String issuePlace;

    @Schema(description = "签单日期")
    private LocalDate issueDate;

    @Schema(description = "签发小船提单")
    private Boolean issueFeederBl;

    @Schema(description = "签发小船装港")
    private Boolean issueFeederPlace;

    @Schema(description = "提单主体代码")
    @Length(max = 5, message = "{blno.blentity.length}")
    private String blEntity;

    @Schema(description = "出口操作代理")
    @Length(max = 50, message = "{blno.poroperateagentcode.length}")
    private String porOperateAgentCode;

    @Schema(description = "进口操作代理")
    @Length(max = 50, message = "{blno.deloperateagentcode.length}")
    private String delOperateAgentCode;

    @Schema(description = "进口报关用中转类型")
    @Length(max = 50, message = "{blno.transittermim.length}")
    private String transitTermIm;

    @Schema(description = "进口费用锁")
    private Boolean exPaymentLock;

    @Schema(description = "出口费用锁")
    private Boolean imPaymentLock;

    @Schema(description = "流程实例id", example = "11250")
    @Length(max = 50, message = "{blno.processinstanceid.length}")
    private String processInstanceId;

    @Schema(description = "审批流状态", example = "2")
    private Integer approveStatus;

    @Schema(description = "目的港提单标记")
    private Boolean podBlFlag;

    @Schema(description = "数据来源", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blno.datasource.notblank}")
    @Length(max = 64, message = "{blno.datasource.length}")
    private String datasource;

    @Schema(description = "日本海关舱单")
    @Length(max = 50, message = "{blno.housebillno.length}")
    private String houseBillNo;

    @Schema(description = "申请签单的时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime signOrderTime;

    @Schema(description = "D/O 锁")
    private Boolean doLock;

    @Schema(description = "SI确认标记")
    private Boolean siConfirmFlag;

    @Schema(description = "扣单标识")
    private Boolean restrictionFlag;

    @Schema(description = "电子保函登记类型")
    @Length(max = 20, message = "{blno.elgReceive.length}")
    private String elgReceive;

    @Schema(description = "正本保函登记类型")
    @Length(max = 20, message = "{blno.lgReceive.length}")
    private String lgReceive;

    @Schema(description = "日本目的港专用")
    private String houseBill;

    @Schema(description = "原版本提单id")
    private Long oldBlnoId;

    @Schema(description = "si 更改状态")
    private String siChangeStatus;

    @Schema(description = "si 数据有效标记 0：待审核 1：有效（提单创建默认）2：无效数据")
    private String valid;

}
